<?php

class OPPlayer {
	/**
	* -------------------------------------------------------------------------
	*
	* 									Attributes
	*
	* -------------------------------------------------------------------------
	*/
	
	/**
	 * Emei identifier of the player
	 * 
	 * @var String
	 */
	protected $emei;
	
	/**
	* Position of the player
	*
	* @var OPPosition
	*/
	protected $position;
	
	/**
	 * -------------------------------------------------------------------------
	 * 
	 * 									Static
	 * 
	 * -------------------------------------------------------------------------
	 */
	
	/**
	 * Static constructor creating a new Player with his emei number
	 * 
	 * @param $emei
	 * @return OPPlayer
	 */
	public static function newWithEmei($emei){
		$newPlayer = new OPPlayer();
		$newPlayer->setEmei($emei);
		
		return $newPlayer;
		
	}
	
	/**
	* Static constructor creating a new Player with his emei number and position
	*
	* @param $emei
	* @return OPPlayer
	*/
	public static function newWithEmeiAndPosition($emei, $position){
		$newPlayer = OPPlayer::newWithEmei($emei);
		$newPlayer->setPosition($position);
	
		return $newPlayer;
	
	}
	
	/**
	* -------------------------------------------------------------------------
	*
	* 									Dynamic
	*
	* -------------------------------------------------------------------------
	*/
	
	/**
	* -------------------------------------------------------------------------
	* 									Setters
	* -------------------------------------------------------------------------
	*/
	
	/**
	 * Set the emei to the player
	 * 
	 * @param $emei
	 * @return OPPlayer
	 */
	public function setEmei($emei) {
		$this->emei = $emei;
		
		return $this;
		
	}
	
	/**
	* Set player's position
	*
	* @param $position
	* @return OPPLayer
	*/
	public function setPosition($position) {
		$this->position = $position;
	
		return $this;
	
	}
	
	/**
	* -------------------------------------------------------------------------
	* 									Getters
	* -------------------------------------------------------------------------
	*/
	
	/**
	 * Return the emei of the player
	 *
	 * @return String
	 */
	public function emei() {
		return $this->emei;
	
	}
	
	/**
	* Return the position of the player
	*
	* @return OPPosition
	*/
	public function position() {
		return $this->position;
	
	}
	
	/**
	 * Return the faction of the player
	 * 
	 * @return string
	 */
	public function faction() {
		throw new Exception('Subclass Responsability');
				
	}
	
	/**
	* -------------------------------------------------------------------------
	* 									Testing
	* -------------------------------------------------------------------------
	*/
	
	/**
	 * Return if the player is a rebel
	 * 
	 * @return boolean
	 */
	public function isARebel() {
		throw new Exception('Subclass Responsability');
		
	}
	
	/**
	* Return if the player is an oppressor
	*
	* @return boolean
	*/
	public function isAnOppressor() {
		throw new Exception('Subclass Responsability');
			
	}
	
	
}